package com.umeox.watch.moto.dataservice.db.dao;


import androidx.annotation.NonNull;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.umeox.watch.moto.dataservice.db.model.IMGroup;

import java.util.List;

@Dao
public interface IMGroupDao {
    @Query("SELECT * FROM im_group WHERE id=:id")
    IMGroup query(int id);

    @Query("SELECT * FROM im_group")
    List<IMGroup> queryAll();

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    long save(@NonNull IMGroup imGroup);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(List<IMGroup> items);

    @Delete
    int delete(IMGroup imGroup);

    @Delete
    void delete(List<IMGroup> items);

    @Query("DELETE FROM im_group")
    int deleteAll();

}
